You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > TMtxInt Class > TMtxInt Methods > TMtxInt.SetSubRange Method
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
TMtxInt.SetSubRange Method

Defines a sub vector/matrix.

Syntax
C#
Visual Basic
public void SetSubRange([In] TMtxVecInt Src, int Index, int aRows, int aCols);

The method will define a subarray starting at Index and ending at Index + (aRows*aCols)-1. No copying will occur, only pointers will be shifted or indices adjusted. The subranged matrix will have the size aRows and aCols. Length will be equal to aRows*aCols. 

All values of the original TMtxVecBase will be preserved. An exception will be raised if an attempt is made to change the size of calling object. 

A sub-vector/matrix is vector/matrix, which does not have its own memory allocated. Instead it adopts the memory of the source object and all operations done on either of the objects affect the same elements. The use of subvectors/submatrices increases CPU cache reuse, lower's memory requirements, increases application performance and improves code readability. 

To again obtain a view of the full vector/matrix, see TMtxVecBase.SetFullRange 

The routine only makes sense to be used where aCols matches Src.Cols. MtxVec has only limited support for matrices where the matrix rows are not stored strictly consecutively. This overload is to be used with great caution. 

The routine should not be mixed with other SetSubRange routines or subrange stack.

Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!